package com.czh.mybatisplus.Enum;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;


/**
 * user实体类sex字段枚举,注：sex字段类型需改成枚举
 */
@AllArgsConstructor
public enum sexEnum implements IEnum<Integer> {

    boy(0,"女"),
    girl(1,"男");

    private final Integer code;
    // 序列化枚举值为 接口出参；接口入参（RequestBody），反序列化为枚举值
    @JsonValue
    private final String sex;

    @Override
    public Integer getValue() {
        return code;
    }
}
